( )
ErrorsCollection

( )

Synthesised documentation from language/operators language/operators

From language/operators

See Original text in context

The grouping operator.

An empty group () creates an empty list. Parentheses around non-empty expressions simply structure the expression, but do not have additional semantics.

In an argument list, putting parenthesis around an argument prevents it from being interpreted as a named argument.

multi sub p(:$a!{ say 'named'      }
multi sub p($a)   { say 'positional' }
p => 1;           # OUTPUT: «named␤» 
p (=> 1);         # OUTPUT: «positional␤»

From language/operators

See Original text in context

The call operator treats the invocant as a Callable and invokes it, using the expression between the parentheses as arguments.

Note that an identifier followed by a pair of parentheses is always parsed as a subroutine call.

If you want your objects to respond to the call operator, implement a method CALL-ME.